package com.xs.designpattern;

import lombok.extern.slf4j.Slf4j;

/**
 * @author xs
 */
@Slf4j
public class Main {
    public static void main(String[] args) {
        // 初始化实现多例
        log.info("通过初始化实现多例");
        log.info("KHAMUL={}", Nazgul.getInstance(NazgulName.KHAMUL));
        log.info("MURAZOR={}", Nazgul.getInstance(NazgulName.MURAZOR));
        log.info("DWAR={}", Nazgul.getInstance(NazgulName.DWAR));
        log.info("JI_INDUR={}", Nazgul.getInstance(NazgulName.JI_INDUR));
        log.info("AKHORAHIL={}", Nazgul.getInstance(NazgulName.AKHORAHIL));
        log.info("HOARMURATH={}", Nazgul.getInstance(NazgulName.HOARMURATH));
        log.info("ADUNAPHEL={}", Nazgul.getInstance(NazgulName.ADUNAPHEL));
        log.info("REN={}", Nazgul.getInstance(NazgulName.REN));
        log.info("UVATHA={}", Nazgul.getInstance(NazgulName.UVATHA));

        // 枚举实现多例
        log.info("通过枚举实现多例");
        log.info("KHAMUL={}", NazgulEnum.KHAMUL);
        log.info("MURAZOR={}", NazgulEnum.MURAZOR);
        log.info("DWAR={}", NazgulEnum.DWAR);
        log.info("JI_INDUR={}", NazgulEnum.JI_INDUR);
        log.info("AKHORAHIL={}", NazgulEnum.AKHORAHIL);
        log.info("HOARMURATH={}", NazgulEnum.HOARMURATH);
        log.info("ADUNAPHEL={}", NazgulEnum.ADUNAPHEL);
        log.info("REN={}", NazgulEnum.REN);
        log.info("UVATHA={}", NazgulEnum.UVATHA);
    }
}